grammar <grammarName>;
s @after {<ToStringTree("$ctx"):writeln()>} : e EOF; // must indicate EOF can follow or 'a\<EOF>' won't match
e :\<assoc=right> e '*' e
  |\<assoc=right> e '+' e
  |\<assoc=right> e '?' e ':' e
  |\<assoc=right> e '=' e
  | ID
  ;
ID : 'a'..'z'+ ;
WS : (' '|'\n') -> skip ;
